<!--
 * @Author: your name
 * @Date: 2022-02-12 15:41:58
 * @LastEditTime: 2022-02-12 20:40:07
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \vue3-ts-food-admin\src\components\appHeader\appHeader.vue
-->
<template>
  <div class="appHeaderCont">
    <div class="companyName">{{ info.company }}</div>
    <div class="headerRight">
      <div class="userAvatarInfo">
        <div class="userName">{{ info.name }}</div>
        <img :src="info.imgUrl" alt="用户头像" class="userImg" />
      </div>
      <div class="handleArea">
        <el-badge :value="5" style="margin-right: 30px">
          <el-icon :size="20" color="#333" class="handleIcon"
            ><elicon-chat-dot-square
          /></el-icon>
        </el-badge>

        <el-icon :size="20" color="#333" class="handleIcon"
          ><elicon-switch-button
        /></el-icon>
      </div>
    </div>
  </div>
</template>

<script lang="ts">
import { defineComponent, PropType, watch } from "vue";
import { UserInfo } from "@/types/index";

export default defineComponent({
  props: {
    info: {
      type: Object as PropType<UserInfo>,
      default: {
        name: "",
        company: "",
        imgUrl: "",
      },
    },
  },
  setup() {},
  mounted() {
    console.log(this.info);
  },
});
</script>
<style lang="less" scoped>
.appHeaderCont {
  display: flex;
  height: 100%;
  justify-content: space-between;
  align-items: center;
  .companyName {
    color: #666;
    font-size: 16px;
    margin-left: 32px;
  }
  .headerRight {
    margin-right: 32px;
    display: flex;
    .userAvatarInfo {
      margin-right: 30px;
      display: flex;
      align-items: center;
      .userName {
        color: #909290;
        font-size: 16px;
        margin-right: 16px;
      }
      .userImg {
        width: 48px;
        height: 48px;
        border-radius: 24px;
      }
    }
    .handleArea {
      display: flex;
      align-items: center;

      .handleIcon {
        cursor: pointer;
      }
    }
  }
}
</style>
